#pragma once
#include <string>
#include "server/rtmp/amf0/amf0_inc.hpp"
#include "server/rtmp/rtmp_protocol/rtmp_define.hpp"

namespace mms
{
    class RtmpMessage;
    class RtmpPublishMessage
    {
    public:
        RtmpPublishMessage();
        RtmpPublishMessage(int32_t transaction_id, const std::string &stream_name, const std::string &pub_type);
        virtual ~RtmpPublishMessage();

    public:
        int32_t decode(std::shared_ptr<RtmpMessage> rtmp_msg);
        std::shared_ptr<RtmpMessage> encode();
        int32_t size();
        const std::string &stream_name() const;

    public:
        Amf0String command_name_;
        Amf0Number transaction_id_;
        Amf0Object command_obj_;
        Amf0Null null_;
        Amf0String stream_name_;
        Amf0String publish_type_;
    };

};